/**
 * Copyright 2018
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.dream.inspect.modules.sys.dao;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.dream.inspect.modules.dream.pojo.SysDeptFormMap;
import com.dream.inspect.modules.sys.entity.SysDeptEntity;
import org.apache.ibatis.annotations.Param;

/**
 * 部门管理
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2017-06-20 15:23:47
 */
public interface SysDeptDao extends BaseMapper<SysDeptEntity> {

    /**
     * 查询子部门ID列表
     * @param parentId  上级部门ID
     */
    List<Long> queryDetpIdList(Long parentId);

    /**
     * 查询所有部门
     * @return
     */
    List<SysDeptEntity> queryAllDeptList();

    List<Map<String, Object>> queryDeptList(Map<String, Object> map);

    int queryDeptListCount(Map<String, Object> map);

    String queryDeptNameById(@Param("id") Long id);

    List<SysDeptFormMap> findTreeDept(Map<String, Object> params);

    List<SysDeptFormMap> findNextDepts(Map<String, Object> params);

    List<SysDeptFormMap> findDeptByParentCode(Map<String, Object> params);

    List<SysDeptFormMap> findNextDeptByParentCode(Map<String, Object> params);

    List<SysDeptFormMap> findAllOtherDept(Map<String, Object> params);


    List<SysDeptFormMap> getAllDcdw();

    List<SysDeptFormMap> getAlldcuser();

    void editQhIdByRangeCode(@Param("deptId") Long deptId, @Param("rangeCode") String rangeCode);
}
